package com.rsk.dao.info;


import java.io.Serializable;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.rsk.entity.info.RskInformation;



@Repository
public interface RskInformationRepository extends JpaRepository<RskInformation, Long>,JpaSpecificationExecutor<RskInformation>,Serializable {
	
	@Modifying
	@Query(value = "update rsk_information set is_del = 1, operator_user =?2, operator_time = NOW() where id =?1", nativeQuery = true)
	public int delInformation(Long id, Long operatorUser);
	
	@Modifying
	@Query(value = "update rsk_information set information_read = information_read+1 where id =?1", nativeQuery = true)
	public int updateInformationRead(Long id);
	
	@Modifying
	@Query(value = "update rsk_information set information_status = ?2, operator_user =?2, operator_time = NOW() where id =?1", nativeQuery = true)
	public int updateInformationStatus(Long id, Integer informationStatus, Long operator_user);
	
}
 